Ext.define('Jason.view.protal.authentication.Register', {
    extend: 'Ext.container.Container',
    xtype: 'authregister',
    requires: [
        'Ext.form.Label',
        'Ext.form.field.Text',
        'Ext.form.field.Checkbox',
        'Ext.button.Button'
    ],
    autoScroll: true,
    title: '新账号注册',
    defaultFocus: 'authdialog',
    layout: 'center',
    items: [
        {
            xtype: 'form', style: 'border:1px solid #dfe1e6;border-radius:6px;',
            bodyPadding: '20 20',
            width: 480,
            reference: 'authDialog',
            defaultButton: 'submitButton',
            autoComplete: true,
            cls: 'auth-dialog-register',
            layout: {
                type: 'vbox',
                align: 'stretch'
            },
            defaults: {
                margin: '10 0',
                selectOnFocus: true
            },
            items: [
                {
                    colspan: 3,
                    xtype: 'label',
                    html: '<fieldset style="border-width: 1px 0 0;border-style: solid;">' +
                        '	<legend style="margin-left: 20px;padding: 0 10px;font-size: 20px;font-weight: 300;">' +
                        '创建一个新的帐号'
                        + '</legend>' +
                        '</fieldset>'
                },
                {
                    xtype: 'textfield',
                    cls: 'auth-textbox',
                    height: 55,
                    hideLabel: true,
                    allowBlank: false,
                    emptyText: '真实姓名', vtype: 'checkName',
                    name: 'realname'
                },
                {
                    xtype: 'textfield',
                    cls: 'auth-textbox',
                    height: 55,
                    hideLabel: true,
                    allowBlank: false,
                    name: 'mobphone',
                    vtype: 'checkMobildAndTel',
                    emptyText: '联系电话（登录系统使用）'
                },
                {
                    xtype: 'textfield',
                    height: 55,
                    hideLabel: true,
                    allowBlank: false,
                    emptyText: '登陆密码',
                    minLength: 6,
                    maxLength: 12,
                    name: 'password',
                    inputType: 'password'
                }, {
                    hideLabel: true,
                    height: 55,
                    xtype: 'comboTree',
                    valueField: 'id',
                    displayField: 'deptname',
                    store: Ext.create('Ext.data.TreeStore', {
                        fields: [
                            { name: 'id', mapping: 'id' },
                            { name: 'text', mapping: 'deptname' },
                            'children',
                            'leaf'
                        ],
                        autoLoad: false,
                        rootVisible: true,
                        proxy: {
                            type: 'ajax',
                            url: reqUrl.sys.organize.leftMenu,
                            rootProperty: function (data) {
                                return data;
                            }
                        }
                    }),
                    listeners: {
                    },
                    allowBlank: false,
                    afterLabelTextTpl: cfg.required,
                    name: 'deptcode',
                    emptyText: '请选择...'
                }, {
                    editable: false,
                    height: 55,
                    hideLabel: true,
                    xtype: 'RemoteCombobox',
                    name: 'post',
                    emptyText: '请选择职务...',
                    model: Ext.create('Ext.data.Model', {
                        fields: ['key', 'value']
                    }),
                    valueField: 'value',
                    displayField: 'key', selectOnFocus: false,
                    proxy_url: reqUrl.sys.comboData.dict + "Duty",
                    allowBlank: false,
                    afterLabelTextTpl: cfg.required,
                    blankText: '职务不能为空',
                    fieldLabel: '职务'
                }, {
                    xtype: 'button',
                    ui: 'soft-green',
                    formBind: true,
                    reference: 'submitButton',
                    bind: false,
                    margin: '5 0',
                    scale: 'large',
                    iconAlign: 'right',
                    iconCls: 'x-fa fa-angle-right',
                    text: '注册',
                    listeners: {
                        click: 'onSignupClick'
                    }
                },
                {
                    xtype: 'container',html: '返回<a href="#login">登陆</a>'
                }
            ]
        }, {
            xtype: 'component',
            itemId: 'globalToast',
            floating: true,
            y: 10,
            shadow: false,
            hideMode: 'offsets',
            cls: 'global-toast',
            showAnimation: 'slideIn',
            html: ''
        }
    ]
});
